package com.wnxy.carl.api;

import com.wnxy.carl.dto.OrderDTO;
import com.wnxy.carl.dto.PageDTO;
import com.wnxy.carl.dto.StatisticsOrderDTO;
import com.wnxy.carl.param.PageParam;
import com.wnxy.carl.param.order.*;
import com.wnxy.carl.response.EPage;
import com.wnxy.carl.response.Result;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "carlOrderServe",contextId = "OrderApi",path = "order")
@Api(tags = "订单管理", description = "提供用户相关的 Order API")
public interface OrderApi {


    @PostMapping("generateOrder")//生成订单 OrderDTO
    public Result<OrderDTO> generateOrder(@RequestBody GenerateOrderParam generateOrderParam);

    @PostMapping("amendOrder")//修改订单 Boolean
    public Result<OrderDTO> amendOrder(@RequestBody AmendOrderParam amendOrderParam);

    @GetMapping("alipay")//支付宝支付 String
    public Result alipay(@RequestParam("orderId") Integer orderId);

    @PostMapping("balancePay")//账户余额支付 Boolean
    public Result balancePay(@RequestBody MoneyPayParam moneyPayParam);
    /**
     * 用户订单查询
     */
    @PostMapping("myOrder")//用户查询订单 PageDTO<OrderDTO>
    public Result<? extends EPage<OrderDTO>> myOrder(@RequestBody PageParam<MyOrderParam> pageParam);

    /**
     * 门店订单
     */

    @PostMapping("seeStoreOrder")//名单查询订单 PageDTO<OrderDTO>
    public Result<? extends EPage<OrderDTO>> seeStoreOrder(@RequestBody PageParam<SeeStoreOrderParam> pageParam);

    @PostMapping("statisticsOrder")//用于时间段订单信息的统计 StatisticsOrderDTO
    public Result<StatisticsOrderDTO> statisticsOrder(@RequestBody PageParam<StatisticsOrderParam> pageParam);


}
